﻿using System;
using System.Configuration;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BadmintonApp.Entity;
using BadmintonApp.BLL.Interface;
using BadmintonApp.DAO.Interface;
using BadmintonApp.Factory;

namespace BadmintonApp.BLL.Implement
{
    public class ActivityBLL: IActivityBLL
    {
        private IActivityDAO dao;

        public ActivityBLL()
        {
            dao = DaoFactory.CreateActivityDAO();
        }

        /// <summary>
        /// 插入活动信息
        /// </summary>
        /// <param name="activityInfo">活动信息类</param>
        public void InsertActivity(TActivityInfo activityInfo)
        {
            dao.InsertActivity(activityInfo);
        }

        /// <summary>
        /// 更新活动信息
        /// </summary>
        /// <param name="activityInfo">活动信息类</param>
        public void UpdateActivity(TActivityInfo activityInfo)
        {
            dao.UpdateActivity(activityInfo);
        }

        /// <summary>
        /// 删除活动信息
        /// </summary>
        /// <param name="id">活动信息类</param>
        public void DeleteActivity(int id)
        {
            dao.DeleteActivity(id);
        }

        /// <summary>
        /// 获取所有的活动信息
        /// </summary>
        /// <returns>活动数据集</returns>
        public DataSet GetAllActivity()
        {
            return dao.GetAllActivity();
        }
    }
}
